<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script src="../Ajax-day02/03-源代码/00.knowledges/lib/axios.js"></script>
    <script>
        //promise是个对象 代表了请求成功 或失败的结果
        // axios返回的就是一个promise
        const res = axios({
            url: 'http://ajax-api.itheima.net/api/news'
        })
        const p = new Promise(function (resolve, reject) {
            // reject('失败了')
            resolve('成功了')
        }).then((res) => {
            console.log(res);
        }).catch((err) => {
            console.log(err);
        })
    </script>
</body>

</html>